﻿@using LdCms.EF.DbModels
@using LdCms.EF.DbModels
@using LdCms.Common.Utility
@using LdCms.Common.Extension
@model Ld_Member_Settings
@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页<span class="c-gray en">&gt;</span>会员管理 <span class="c-gray en">&gt;</span>设置管理
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<article class="page-container bg-eee" style="min-height:778px;">
    <div class="cl pd-20 bg-fff" style="min-height:736px;">
        <div class="tabBar cl clearfix">
            <span>基本设置</span>
        </div>
        <div class="mt-15">
            <form action="@Url.Action("update")" method="post" class="form form-horizontal" id="form-add">
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>注册开关：</label>
                    <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                        <div class="radio-box">
                            <input type="radio" id="sex-11" name="fIsRegister" value="1" @(Model.IsRegister.ToBool() ? "checked" : "") />
                            <label for="sex-11">开启</label>
                        </div>
                        <div class="radio-box">
                            <input type="radio" id="sex-12" name="fIsRegister" value="0" @(Model.IsRegister.ToBool() ? "" : "checked") />
                            <label for="sex-12">关闭</label>
                        </div>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>短信验证开关：</label>
                    <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                        <div class="radio-box">
                            <input type="radio" id="sex-21" name="fIsSmsCode" value="1" @(Model.IsSmsCode.ToBool() ? "checked" : "") />
                            <label for="sex-21">开启</label>
                        </div>
                        <div class="radio-box">
                            <input type="radio" id="sex-22" name="fIsSmsCode" value="0" @(Model.IsSmsCode.ToBool() ? "" : "checked") />
                            <label for="sex-22">关闭</label>
                        </div>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>积分开关：</label>
                    <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                        <div class="radio-box">
                            <input type="radio" id="sex-31" name="fIsPoint" value="1" @(Model.IsPoint.ToBool() ? "checked" : "") />
                            <label for="sex-31">开启</label>
                        </div>
                        <div class="radio-box">
                            <input type="radio" id="sex-32" name="fIsPoint" value="0" @(Model.IsPoint.ToBool() ? "" : "checked") />
                            <label for="sex-32">关闭</label>
                        </div>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">新用户赠送积分：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="@Model.NewUserPoint" placeholder="新用户赠送积分" id="fNewUserPoint" name="fNewUserPoint" />
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">登录赠送积分：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="@Model.LoginPoint" placeholder="登录赠送积分" id="fLoginPoint" name="fLoginPoint" />
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">签到赠送积分：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="@Model.SignINPoint" placeholder="SEO签到赠送积分" id="fSignINPoint" name="fSignINPoint" />
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>订单赠送积分类别：</label>
                    <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                        <div class="radio-box">
                            <input type="radio" id="sex-41" name="fOrderPointType" value="1" @(Model.OrderPointType.ToInt() == 1 ? "checked" : "") />
                            <label for="sex-41">固定积分</label>
                        </div>
                        <div class="radio-box">
                            <input type="radio" id="sex-42" name="fOrderPointType" value="2" @(Model.OrderPointType.ToInt() == 2 ? "checked" : "") />
                            <label for="sex-42">比例计算</label>
                        </div>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">订单赠送积分：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="@Model.OrderPoint" placeholder="订单赠送积分" id="fOrderPoint" name="fOrderPoint" />
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">评价赠送积分：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="@Model.CommentPoint" placeholder="评价赠送积分" id="fCommentPoint" name="fCommentPoint" />
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">备注：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <textarea id="fRemark" name="fRemark" class="textarea" placeholder="备注" dragonfly="true">@Model.Remark</textarea>
                        <p class="textarea-numberbar"><em class="textarea-length"></em>/100</p>
                    </div>
                </div>
                <div class="row cl">
                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                    </div>
                </div>
            </form>
        </div>
    </div>
</article>
@*
    --------------
    页面底部JS脚本
    --------------
*@
@section scripts{
    <!--请在下方写此页面业务相关的脚本-->
    <script type="text/javascript" src="~/content/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
    <script type="text/javascript" src="~/content/admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
    <script type="text/javascript" src="~/content/admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
    <script type="text/javascript" src="~/content/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
    <script type="text/javascript" src="~/content/admin/static/h-ui.admin/js/H-ui.admin.common.js"></script>
    <script type="text/javascript">
        (function ($) {
            $.mainu = {
                init: function () {
                    $('.skin-minimal input').iCheck({
                        checkboxClass: 'icheckbox-blue',
                        radioClass: 'iradio-blue',
                        increaseArea: '20%'
                    });
                    $("#fRemark").Huitextarealength({
                        minlength: 4,
                        maxlength: 100
                    });
                },
                formSubmit: function () {
                    $("#form-add").validate({
                        rules: {
                            fName: {
                                required: true
                            }
                        },
                        onkeyup: false,
                        focusCleanup: true,
                        success: "valid",
                        submitHandler: function (form) {
                            $(form).ajaxSubmit({
                                type: "POST",
                                cache: false,
                                data: {
                                },
                                dataType: "json",
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    if (XMLHttpRequest.status != 200) {
                                        layer.alert("POST[FAIL]", { icon: 5 });
                                    }
                                },
                                success: function (result) {
                                    var state = result.state;
                                    var message = result.message;
                                    if (state == "success") {
                                        layer.msg(message, { icon: 6, time: 3000 });
                                    } else {
                                        layer.msg(message, { icon: 5, time: 3000 });
                                    }
                                }
                            });
                        }
                    });
                }
            };
            $(function () {
                $.mainu.init();
                $.mainu.formSubmit();
            });

        })(jQuery);
    </script>
}

